package main

import (
	"spider/engine"
	"spider/persist"
	"spider/scheduler"
	"spider/zhenai/parser"
)

func dfs(int i) int {
	if i == 1 || i == 0 {
		return 1
	}
	if(fib[i] != 0)
		return fib[i]
	fib[i] = dfs(i-1) + dfs(i-2)
	return fib[i]
}

func main() {

	//ConcurrentEngine
	//
	ItemChan, err := persist.ItemSaver("dating_paofile")
	if err != nil {
		panic(err)
	}
	e := engine.ConcurrentEngine{
		Scheduler:   &scheduler.SimpleScheduler{},
		WorkerCount: 10,
		//ItemSaver:   persist.ItemSaver(),
		ItemSaver: ItemChan,
	}
	/*e.Run(engine.Request{
		Url:        "http://www.zhenai.com/zhenghun",
		ParserFunc: parser.ParserCityList,
	})
	*/

	e.Run(engine.Request{
		Url:        "http://www.zhenai.com/zhenghun/shanghai",
		ParserFunc: parser.ParserCity,
	})
}
